package com.monkey.toolsshop.user.enums;

/**
 * 用户状态枚举类型
 * */
public enum EnumUserStatus {

    ENABLE(0,"启用"),
    FORBIDDEN(1,"禁用");

    private Integer code;
    private String name;

    private EnumUserStatus(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static EnumUserStatus getEnum(Integer code) {
        for (EnumUserStatus enumValue : EnumUserStatus.values()) {
            if (enumValue.getCode().equals(code)) {
                return enumValue;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
